<!-- 
<script>
export default {
  data(){
    return {num:0}
  },methods:{
    add(){
      this.num++;
    }
  },mounted(){
      this.num =321;
  }
}
</script> -->

<script setup>
  import {ref} from 'vue'

  const num =ref(10);

  function add(){
    num.value++
  }


</script>

<template>
  <div>
    <h1>计数器 {{num}}</h1>

    <button @click="add">点我+1</button>
 
    <el-button type="primary" @click="add">点我+1</el-button> 
  </div>
</template>
